import request from '@/config/axios'

// 工序信息 VO
export interface ProcessInfoVO {
  id: string // 工序编码
  processCode: string // 工序编码
  processName: string // 工序名称
}

// 工序信息 API
export const ProcessInfoApi = {
  // 查询工序信息分页
  getProcessInfoPage: async (params: any) => {
    return await request.get({ url: `/opticore/process-info/page`, params })
  },

  // 查询工序信息详情
  getProcessInfo: async (id: number) => {
    return await request.get({ url: `/opticore/process-info/get?id=` + id })
  },

  // 新增工序信息
  createProcessInfo: async (data: ProcessInfoVO) => {
    return await request.post({ url: `/opticore/process-info/create`, data })
  },

  // 修改工序信息
  updateProcessInfo: async (data: ProcessInfoVO) => {
    return await request.put({ url: `/opticore/process-info/update`, data })
  },

  // 删除工序信息
  deleteProcessInfo: async (id: number) => {
    return await request.delete({ url: `/opticore/process-info/delete?id=` + id })
  },

  // 导出工序信息 Excel
  exportProcessInfo: async (params) => {
    return await request.download({ url: `/opticore/process-info/export-excel`, params })
  },

  //获取产线列表
  fetchProcessNameList: async () => {
    return await request.get({ url: `/opticore/process-info/getProcessList` })
  },

  //获取产线列表
  fetchProcessDoList: async () => {
    return await request.get({ url: `/opticore/process-info/getProcessDoList` })
  }
}
